import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    name: "lottery",
    component: () => import("@/views/lottery"),
  },
  {
    name: "newNum",
    path: "/newNum",
    component: () => import("@/views/tochangenum/savenum"),
  },

  //走势图
  {
    name: "zst",
    path: "/zst/:gid/:current",
    component: () => import("@/views/zst/index"),
  },
  {
    name: "backHome",
    path:"/backHome/:gidName",
    component: () => import("@/components/backHome"),
  },
  {
    name: "history",
    path: "/history",
    component: () => import("@/views/larrypage/index"),
  },

  //详情页面跳转
  // 开奖详情
  {
    path: "/details",
    name: "details",
    component: () => import("@/views/details"),
  },

  {
    path: "/information",
    name: "information",
    component: () => import("@/views/information"),
  },

  // 玩法
  {
    path: '/paly',
    component: () => import('@/views/playshow/index'),
    children: [
      {
        path: "01",
        name: "paly01",
        component: () => import("@/views/playshow/indextwocolore"),
      },
      {
        path: "03",
        name: "paly03",
        component: () => import("@/views/playshow/indexGrandlotto"),
      },
      {
        path: "07",
        name: "paly07",
        component: () => import("@/views/playshow/indexseven"),
      },
      {
        path: "50",
        name: "play50",
        component: () => import("@/views/playshow/superGrandlotto"),
      },
      {
        path: "51",
        name: "play51",
        component: () => import("@/views/playshow/SevenStarcolor"),
      },
      {
        path: "52",
        name: "play52",
        component: () => import("@/views/playshow/fiveline"),
      },
      {
        path: "53",
        name: "play53",
        component: () => import("@/views/playshow/threefive"),
      },
      {
        path: "80",
        name: "play80",
        component: () => import("@/views/playshow/virtory"),
      },
      {
        path: "81",
        name: "play81",
        component: () => import("@/views/playshow/ninePlay"),
      },
      {
        path: "83",
        name: "play83",
        component: () => import("@/views/playshow/goball"),
      },
      {
        path: "82",
        name: "play82",
        component: () => import("@/views/playshow/SixHalf"),
      },

      {
        path: "1161",
        name: "playhenan",
        component: () => import("@/views/playshow/price/hebei/fiveline"),
      },
      {
        path: "1162",
        name: "20change5",
        component: () => import("@/views/playshow/price/hebei/twenfive"),
      },
      {
        path: "1163",
        name: "pailie7",
        component: () => import("@/views/playshow/price/hebei/sevenline"),
      },
      {
        path: "1164",
        name: "two",
        component: () => import("@/views/playshow/price/hebei/two"),
      },
      {
        path: "1165",
        name: "three",
        component: () => import("@/views/playshow/price/hebei/three"),
      },
      {
        path: "1166",
        name: "liaoning",
        component: () => import("@/views/playshow/price/liaoning"),
      },
      {
        path: "1168",
        name: "heilongjiang6",
        component: () => import("@/views/playshow/price/heilongjiang/longjiangsix"),
      },
      {
        path: "1169",
        name: "heilongjiang2",
        component: () =>
          import("@/views/playshow/price/heilongjiang/Heilongjiangseven"),
      },
      {
        path: "1170",
        name: "playInfo",
        component: () => import("@/views/playshow/price/heilongjiang/twentwo"),
      },
      {
        path: "1171",
        name: "palyPsixTwo",
        component: () =>
          import("@/views/playshow/price/heilongjiang/heilonhjiangP"),
      },
      {
        path: "1172",
        name: "shanghai4",
        component: () => import("@/views/playshow/price/shanghai/fourshanghai"),
      },
      {
        path: "1173",
        name: "shanghai5",
        component: () => import("@/views/playshow/price/shanghai/fivelenth"),
      },
      {
        path: "1174",
        name: "shanghaisix",
        component: () =>
          import("@/views/playshow/price/shanghai/shanghaisixaddone"),
      },
      {
        path: "1175",
        name: "tenfive",
        component: () => import("@/views/playshow/price/jiangsu/tenfive"),
      },

      {
        path: "1176",
        name: "jiangsusixandone",
        component: () => import("@/views/playshow/price/jiangsu/sixandone"),
      },

      {
        path: "1177",
        name: "jiangsuseven1177",
        component: () => import("@/views/playshow/price/jiangsu/seven"),
      },
      // 浙江地方
      {
        path: "1178",
        name: "jiangsuseven1178",
        component: () => import("@/views/playshow/price/zhejiang/sixandone"),
      },
      {
        path: "1179",
        name: "tenfivefive1177",
        component: () => import("@/views/playshow/price/zhejiang/twenfive"),
      },
      {
        path: "1180",
        name: "tenfivefive1180",
        component: () => import("@/views/playshow/price/zhejiang/tenfivefive"),
      },
      {
        path: "1181",
        name: "last",
        component: () => import("@/views/playshow/price/zhejiang/last"),
      },
      //安徽
      {
        path: "1182",
        name: "anhui",
        component: () => import("@/views/playshow/price/anhui"),
      },
      // 福建
      {
        path: "1183",
        name: "fujian1",
        component: () => import("@/views/playshow/price/fujian/sevensix"),
      },
      {
        path: "1184",
        name: "fujian31选7",
        component: () => import("@/views/playshow/price/fujian/threeone"),
      },
      {
        path: "1185",
        name: "fujian22选5",
        component: () => import("@/views/playshow/price/fujian/fiveten"),
      },
      {
        path: "1186",
        name: "fujian15选5",
        component: () => import("@/views/playshow/price/fujian/tenandten"),
      },
      //江西
      {
        path: "1187",
        name: "江西",
        component: () => import("@/views/playshow/price/jiangxi"),
      },
      // 河南
      {
        path: "1188",
        name: "河南",
        component: () => import("@/views/playshow/price/henan"),
      },
      // 湖北
      {
        path: "1189",
        name: "湖北",
        component: () => import("@/views/playshow/price/hubei"),
      },
      // 广东
      {
        path: "1190",
        name: "广东",
        component: () => import("@/views/playshow/price/guangdong/threethSix"),
      },
      {
        path: "1191",
        name: "广东好彩",
        component: () => import("@/views/playshow/price/guangdong/goodOne"),
      },
      {
        path: "1192",
        name: "广东深圳风采",
        component: () => import("@/views/playshow/price/guangdong/inhere"),
      },
      {
        path: "1193",
        name: "广西",
        component: () => import("@/views/playshow/price/guangxi"),
      },
      {
        path: "1195",
        name: "新疆35Q7",
        component: () => import("@/views/playshow/price/xinjiang/threeFive"),
      },
      {
        path: "1196",
        name: "新疆25Q7",
        component: () => import("@/views/playshow/price/xinjiang/twoFive"),
      },
      {
        path: "1197",
        name: "新疆18Q7",
        component: () => import("@/views/playshow/price/xinjiang/Qseven"),
      },
      // 高频玩法
      {
        path: "1001",
        name: "北京11选5",
        component: () => import("@/views/playshow/more/beijing/11Q5"),
      },
      {
        path: "1002",
        name: "北京快3",
        component: () => import("@/views/playshow/more/beijing/queit3"),
      },
      {
        path: "1003",
        name: "北京快乐8",
        component: () => import("@/views/playshow/more/beijing/leeight"),
      },
      {
        path: "1004",
        name: "北京PK10",
        component: () => import("@/views/playshow/more/beijing/tenPK"),
      },
      {
        path: "1005",
        name: "天津11Q5",
        component: () => import("@/views/playshow/more/tianjin/11Q5"),
      },
      {
        path: "1006",
        name: "天津快乐10",
        component: () => import("@/views/playshow/more/tianjin/happy10"),
      },
      {
        path: "1007",
        name: "colockclock",
        component: () => import("@/views/playshow/more/tianjin/colock"),
      },
      {
        path: "1008",
        name: "河北11Q5",
        component: () => import("@/views/playshow/more/hebei/11Q5"),
      },
      {
        path: "1009",
        name: "queit31009",
        component: () => import("@/views/playshow/more/hebei/queit3"),
      },
      {
        path: "1010",
        name: "shanxi11Q5",
        component: () => import("@/views/playshow/more/shanxi/11Q5"),
      },
      {
        path: "1011",
        name: "happy10",
        component: () => import("@/views/playshow/more/shanxi/happy10"),
      },
      {
        path: "1012",
        name: "N11Q5",
        component: () => import("@/views/playshow/more/neimenggu/11Q5"),
      },

      {
        path: "1013",
        name: "queit31013",
        component: () => import("@/views/playshow/more/neimenggu/queit3"),
      },
      {
        path: "1014",
        name: "quanyun",
        component: () => import("@/views/playshow/more/liaoning/quanyun"),
      },
      {
        path: "1015",
        name: "quirt12",
        component: () => import("@/views/playshow/more/liaoning/quirt12"),
      },
      {
        path: "1016",
        name: "11Q51016",
        component: () => import("@/views/playshow/more/jilin/11Q5"),
      },
      {
        path: "1017",
        name: "queit31017",
        component: () => import("@/views/playshow/more/jilin/queit3"),
      },
      {
        path: "1018",
        name: "ten",
        component: () => import("@/views/playshow/more/heilongjiang/ten"),
      },
      {
        path: "1019",
        name: "11Q51019",
        component: () => import("@/views/playshow/more/heilongjiang/11Q5"),
      },
      {
        path: "1020",
        name: "11Q51020",
        component: () => import("@/views/playshow/more/shanghai/11Q5"),
      },
      {
        path: "1021",
        name: "queit31021",
        component: () => import("@/views/playshow/more/shanghai/queit3"),
      },
      {
        path: "1022",
        name: "clock1022",
        component: () => import("@/views/playshow/more/shanghai/clock"),
      },
      {
        path: "1023",
        name: "11Q51023",
        component: () => import("@/views/playshow/more/jiangsu/11Q5"),
      },
      {
        path: "1024",
        name: "queit31024",
        component: () => import("@/views/playshow/more/jiangsu/queit3"),
      },
      {
        path: "1025",
        name: "11Q51025",
        component: () => import("@/views/playshow/more/zhejiang/11Q5"),
      },
      {
        path: "1026",
        name: "happy121026",
        component: () => import("@/views/playshow/more/zhejiang/happy12"),
      },
      {
        path: "1027",
        name: "11Q51027",
        component: () => import("@/views/playshow/more/anhui/11Q5"),
      },
      {
        path: "1028",
        name: "queit31028",
        component: () => import("@/views/playshow/more/anhui/queit3"),
      },
      {
        path: "1029",
        name: "queit3",
        component: () => import("@/views/playshow/more/fujian/queit3"),
      },
      {
        path: "1030",
        name: "11Q51030",
        component: () => import("@/views/playshow/more/fujian/11Q5"),
      },
      {
        path: "1031",
        name: "queit31031",
        component: () => import("@/views/playshow/more/jiangxi/queit3"),
      },
      {
        path: "1032",
        name: "11Q51032",
        component: () => import("@/views/playshow/more/jiangxi/11Q5"),
      },
      {
        path: "1033",
        name: "11Q51033",
        component: () => import("@/views/playshow/more/shandong/11Q5"),
      },
      {
        path: "1034",
        name: "queit31034",
        component: () => import("@/views/playshow/more/henan/happyten"),
      },
      {
        path: "1035",
        name: "11Q51035",
        component: () => import("@/views/playshow/more/hubei/11Q5"),
      },
      {
        path: "1036",
        name: "queit31036",
        component: () => import("@/views/playshow/more/hubei/queit3"),
      },
      {
        path: "1037",
        name: "happyten1037",
        component: () => import("@/views/playshow/more/hunan/happyten"),
      },
      {
        path: "1038",
        name: "11Q51038",
        component: () => import("@/views/playshow/more/guangdong/11Q5"),
      },
      {
        path: "1039",
        name: "happyten1039",
        component: () => import("@/views/playshow/more/guangdong/happyten"),
      },
      {
        path: "1040",
        name: "11Q51040",
        component: () => import("@/views/playshow/more/guangxi/11Q5"),
      },
      {
        path: "1041",
        name: "queit31041",
        component: () => import("@/views/playshow/more/guangxi/queit3"),
      },
      {
        path: "1042",
        name: "happyten1042",
        component: () => import("@/views/playshow/more/guangxi/happyten"),
      },
      {
        path: "1043",
        name: "clock1043",
        component: () => import("@/views/playshow/more/chongqing/clock"),
      },
      {
        path: "1044",
        name: "ten1044",
        component: () => import("@/views/playshow/more/chongqing/ten"),
      },
      {
        path: "1045",
        name: "happy121045",
        component: () => import("@/views/playshow/more/sichuan/happy12"),
      },
      {
        path: "1046",
        name: "11Q51046",
        component: () => import("@/views/playshow/more/guizhou/11Q5"),
      },
      {
        path: "1047",
        name: "queit31047",
        component: () => import("@/views/playshow/more/guizhou/queit3"),
      },
      {
        path: "1048",
        name: "11Q51048",
        component: () => import("@/views/playshow/more/yunnan/11Q5"),
      },
      {
        path: "1049",
        name: "clock1049",
        component: () => import("@/views/playshow/more/yunnan/clock"),
      },
      {
        path: "1055",
        name: "happyten1055",
        component: () => import("@/views/playshow/more/yunnan/happyten"),
      },
      {
        path: "1051",
        name: "11Q51051",
        component: () => import("@/views/playshow/more/shanexi/11Q5"),
      },
      {
        path: "1052",
        name: "happyten1052",
        component: () => import("@/views/playshow/more/shanexi/happyten"),
      },
      {
        path: "1053",
        name: "11Q51053",
        component: () => import("@/views/playshow/more/gansu/11Q5"),
      },
      {
        path: "1054",
        name: "queit31054",
        component: () => import("@/views/playshow/more/gansu/queit3"),
      },
      {
        path: "1050",
        name: "queit31050",
        component: () => import("@/views/playshow/more/qinghai/queit3"),
      },
      {
        path: "1056",
        name: "11Q51056",
        component: () => import("@/views/playshow/more/xinjiang/11Q5"),
      },
      {
        path: "1057",
        name: "colock",
        component: () => import("@/views/playshow/more/xinjiang/colock"),
      },
      {
        path:'1160',
        name:'sixandone',
        component:()=>import('@/views/playshow/price/whreePrice/sixQ1')
      },
      {
        path:'1159',
        name:'15Q5',
        component:()=>import('@/views/playshow/price/whreePrice/15Q5')
      },
      {
        path: "1194",
        name:"1194",
        component:()=>import('@/views/playshow/price/hainan')
      }
    ]
  },
  //每一个玩法的详情页
  {
    path: "/selection/01",
    name: "selectionSsq",
    component: () => import("@/views/tochangenum/twocolorball"),
  },
  {
    path: "/selection/03",
    name: "selection03",
    component: () => import("@/views/tochangenum/Fucai3D"),
  },
  {
    path: "/selection/51",
    name: "selection51",
    component: () => import("@/views/tochangenum/sevenBall"),
  },
  {
    path: "/selection/50",
    name: "selection50",
    component: () => import("@/views/tochangenum/biggoods"),
  },
  {
    path: "/selection/07",
    name: "selection07",
    component: () => import("@/views/tochangenum/sevenle"),
  },
  {
    path: "/selection/52",
    name: "selection52",
    component: () => import("@/views/tochangenum/fiveline"),
  },
  {
    path: "/selection/53",
    name: "selection53",
    component: () => import("@/views/tochangenum/theeeline"),
  },
  // 选号界面
  {
    path: "/selectball/01",
    name: "selectball01",
    component: () => import("@/views/tochangenum/savenum"),
  },
  {
    path: "/selectball/03",
    name: "selectball03",
    component: () => import("@/views/tochangenum/savenum"),
  },
  {
    path: "/selectball/07",
    name: "selectball07",
    component: () => import("@/views/tochangenum/savenum"),
  },
  {
    path: "/selectball/50",
    name: "selectball50",
    component: () => import("@/views/tochangenum/savenum"),
  },
  {
    name: "selectball51",
    path: "/selectball/51",
    component: () => import("@/views/tochangenum/savenum"),
  },
  {
    name: "selectball52",
    path: "/selectball/52",
    component: () => import("@/views/tochangenum/savenum"),
  },
  {
    name: "selectball53",
    path: "/selectball/53",
    component: () => import("@/views/tochangenum/savenum"),
  },
]

const router = new VueRouter({
  routes,
  // mode: 'history',
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

 function GetQueryString(name) { //获取指定name的url参数
    if (window.location.href.indexOf('?')>0) {
      var query =window.location.href.split('?')[1];
      var vars = query.split("&");
      for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == name) { return pair[1]; }
      }
      return null;
    }else{
      return null;
    }
}
router.beforeEach((to, from, next) => {
  let cfm = GetQueryString('cfm');
  if (cfm == 'BDALD') 
    to.meta.headType = '1';
  else
    to.meta.headType = '0';
  next()
})
export default router
